


<!-- pass a variable to included page -->
<%@ page import="bcared.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<% 
   String today = null;
   Today t = new Today();
   today = t.getToday();
   request.setAttribute("picture","MRS");
   request.setAttribute("title", "Engineer Home");  
   request.setAttribute("header", "Welcome : Today is " + today); 
   int userid = Integer.parseInt(request.getParameter("userid"));
   int resultmsg = 0;
   String outputmsg = "";
   
   Engineer e = new Engineer(userid, 0);
   int SOID = 0;
   SOID = e.getSOID();
   
	
ServiceOrder curServiceOrder= new ServiceOrder(SOID); 


	
 %>
<%@ include file="header.jsp"%>
<TD width="850" vAlign="top"> 



<%
if (SOID == 0) {
   %> 
   <br/>
   <h2>There are no service orders assigned to you.</h2>
   <%

   } else {
	
	%>
<br /><h2><a href="ServiceOrderDetails2.jsp?SOID=<%=curServiceOrder.getSOID() %>">Service order: <%=curServiceOrder.getSOID() %></a></h2><br />
<table width=100% border=0>	 
<form name=form1 action="engineercheck.jsp" method=post onSubmit="return validateForm()">
    <table width="50%" border="0">
    <table width=1000 border="0">


<tr>
<td width=25%>Service Order ID:</td>
<td width=25%><input maxlength=30 name=soid size=40 type=text readonly=readonly value='<%=curServiceOrder.getSOID() %>'/></td>
<td width=25%>Customer Name:</td>
<td width=25%><input maxlength=30 name=custName size=40 type=text readonly=readonly value='<%=curServiceOrder.getCustomerName() %>'/></td>
</tr>
<tr>
<td width=25%>Service Order Description:</td>
<td width=25%><input maxlength=30 name=soDesc size=40 type=text readonly=readonly value='<%=curServiceOrder.getServiceTypeDescription() %>'/></td>
<td width=25%>Contact Name:</td>
<td width=25%><input maxlength=30 name=contactName size=40 type=text readonly=readonly value='<%=curServiceOrder.getContactName() %>'/></td>
</tr>

<tr>
	<td>Product Name:</td>
	<td><input maxlength=30 name=productName size=40 type=text readonly=readonly value='<%=curServiceOrder.getProductName() %>'/></td>
	<td>Serial Number:</td>
	<td><input maxlength=30 name=serialNumber size=40 type=text readonly=readonly value='<%=curServiceOrder.getSerialNumber() %>'/></td>
</tr>

   
    	<%
    		if (curServiceOrder.getSoStatusID() != 8 && curServiceOrder.getSoStatusID() != 9) {
    			%>
    		<tr>
    			<td><input type="submit" value="Check In" name="checkinsubmit"></td>
    		</tr>
    		<%
    		}
    		else {
    		%>
    	 	<tr>
      			<td style="text-align:right;">Action/Resolution Notes</td>
      			<td>
      				<textarea name="ResNotes" rows=5 cols=60><%//=curServiceOrder.getResolutionNotes()%></textarea>
      			</td>
    		</tr>
    		<tr>
    			<td><input type="submit" value="Check Out" name="checkoutsubmit"></td>
				<td><INPUT TYPE="checkbox" NAME="isResolved" value="true">Is resolved?</td>
    		</tr>
    	
    	<%
    	}
    	 %>
    <input type="hidden" value="<%=request.getParameter("userid")%>" name="userid" />
    <input type="hidden" value="<%=request.getParameter("msgid")%>" name="msgid" />
    <input type="hidden" value="<%=e.getEngineerID() %>" name="engineerID" />
    </table>
    </form>
   <%
	}
	%>
</table>





<%@ include file="footer.jsp"%>
